set(OCTAVEMATLAB_FILES_DIR ${CMAKE_CURRENT_SOURCE_DIR})
file(GLOB OCTAVEMATLAB_FILES "${OCTAVEMATLAB_FILES_DIR}/*.m")

if(OPT_MATLAB)
  add_subdirectory(matlab)
  set(CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}MATLAB_DEPENDS ${CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}MATLAB_DEPENDS} PARENT_SCOPE)
  set(CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}MATLAB_DISPLAY_NAME ${CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}MATLAB_DISPLAY_NAME} PARENT_SCOPE)
  set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
endif()

if(OPT_OCTAVE)
  add_subdirectory(octave)
  set(CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}OCTAVE_DEPENDS ${CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}OCTAVE_DEPENDS} PARENT_SCOPE)
  set(CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}OCTAVE_DISPLAY_NAME ${CPACK_COMPONENT_${COMPONENT_PREFIX_UPPER}OCTAVE_DISPLAY_NAME} PARENT_SCOPE)
  set(CPACK_COMPONENTS_ALL ${CPACK_COMPONENTS_ALL} PARENT_SCOPE)
endif()
